<template>
    <div class="recommend">
        <div class="title">热门推荐</div>
        <ul>
            <router-link tag="li" v-for="item in list" :key="item.id"  :to="'/detail/'+ item.id">
                <div class="item">
                    <img :src="item.imgUrl" alt="">
                    <div>
                        <p class="item-title">{{item.title}}</p>
                        <p class="item-desc">{{item.desc}}</p>
                        <button>查看详情</button>
                    </div>
                </div>
            </router-link>
        </ul>
    </div>
</template>
<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>
<style lang="stylus" scoped>
@import '~@/assets/styles/mixins.styl'
    .title
        line-height .8rem
        margin-top .2rem
        background-color #eee
        text-indent: .2rem
    .item
        height 2rem
        overflow hidden
        display flex
        img
            width 1.8rem
            height 1.8rem
            padding .1rem
        div
            flex 1
            padding .1rem
            .item-title
                margin-top .12rem
                line-height .54rem
                font-size .37rem
                ellipsis()
            .item-desc
                line-height .4rem
                color #ccc
                ellipsis()
            button
                line-height .44rem
                margin-top .16rem
                padding 0 .2rem
                border-radius .02rem
                background-color #ff9300

</style>
